from .gitmgr import Git

url = 'https://gitlab.com'
token = None
git = Git(url=url, private_token=token)


class TestCase:

    def test_list_projects(self):
        res = git.list_projects(search="env", as_list=True,
                                # group="ai",
                                per_page=1
                                )
        print(res)

    def test_list_commits(self):
        res = git.list_commits(project_id=22338887, ref_name="main")
        print(res[0])

    def test_get_files(self):
        res = git.get_file(project_id=22338887, ref="main", file_path="README.md")
        print(res.decode())

    def test_clone(self):
        res = git.clone(address="https://gitlab.com/gitlab-com/support/toolbox/gitlab-smoke-tests.git")
